<template>
  <div class="layout">
    <router-view />
    <!-- route 开启路由模式 -->
    <van-tabbar class="layout_tabbar" route>
      <van-tabbar-item to="/">
        <i slot="icon" class="iconfont toutiaoshouye"></i>
        <span class="text">首页</span>
      </van-tabbar-item>
      <van-tabbar-item to="/q&a">
        <i slot="icon" class="iconfont toutiaowenda"></i>
        <span class="text">问答</span>
      </van-tabbar-item>
      <van-tabbar-item to="/video">
        <i slot="icon" class="iconfont toutiaoshipin"></i>
        <span class="text">视频</span>
      </van-tabbar-item>
      <van-tabbar-item to="/My">
        <i slot="icon" class="iconfont toutiaowode"></i>
        <span class="text">{{ $store.state.user ? '我的' : '未登录' }}</span>
      </van-tabbar-item>
    </van-tabbar>
  </div>
</template>

<script>
export default {
  name: 'layout',
  data() {
    return {};
  },
  created() {},
  merhods: {},
};
</script>

<style lang="less" scoped>
.layout {
  .layout_tabbar {
    .iconfont {
      font-size: 40px;
    }
    .text {
      font-size: 20px;
    }
  }
}
</style>
